<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    {:token()}
    <input type="hidden" name="row[id]" value="{$row.id}">
    {if $auth->acct_id == 0}
    <div class="form-group">
        <label for="content" class="control-label col-xs-12 col-sm-2">{:__('渠道商等级')}:</label>
        <div class="col-xs-12 col-sm-4">
            <!-- {:build_radios('row[is_channel]', ['0'=>__('否'), '1'=>__('是')], $row['is_channel'])} -->
            <select id="c-channel_level" class="form-control selectpicker" name="row[channel_level]">
                {foreach name="channllist" item="vo"}
                <option value="{$key}" {in name="key" value="$row.channel_level" }selected{/in}>{$vo}</option>
                {/foreach}
            </select>
        </div>
    </div>
    {/if}
    <div class="form-group">
        <label for="c-nickname" class="control-label col-xs-12 col-sm-2">{:__('Nickname')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-nickname" data-rule="required" class="form-control" name="row[nickname]" type="text"
                value="{$row.nickname|htmlentities}">
        </div>
    </div>

    <div class="form-group">
        <label for="c-nickname" class="control-label col-xs-12 col-sm-2">{:__('直推上级')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-parent_id" data-rule="required" data-source="user/user/index" data-field="nickname"
                class="form-control selectpage" name="row[parent_id]" type="text" value="{$row.parent_id|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-mobile" class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-mobile" data-rule="" class="form-control" name="row[mobile]" type="text"
                value="{$row.mobile|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-avatar" class="control-label col-xs-12 col-sm-2">{:__('Avatar')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-avatar" data-rule="" class="form-control" size="50" name="row[avatar]" type="text"
                    value="{$row.avatar}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-avatar" class="btn btn-danger faupload"
                            data-input-id="c-avatar" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
                            data-multiple="false" data-preview-id="p-avatar"><i class="fa fa-upload"></i>
                            {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-avatar" class="btn btn-primary fachoose"
                            data-input-id="c-avatar" data-mimetype="image/*" data-multiple="false"><i
                                class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-avatar"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-avatar"></ul>
        </div>
    </div>


    <div class="form-group">
        <label for="c-contact" class="control-label col-xs-12 col-sm-2">{:__('Contact')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-contact" data-rule="" class="form-control" name="row[contact]" type="text"
                value="{$row.contact|htmlentities}">
        </div>
    </div>

    <div class="form-group">
        <label for="c-contact_phone" class="control-label col-xs-12 col-sm-2">{:__('Contact_phone')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-contact_phone" data-rule="" class="form-control" name="row[contact_phone]" type="text"
                value="{$row.contact_phone|htmlentities}">
        </div>
    </div>


    <div class="form-group">
        <label for="c-address" class="control-label col-xs-12 col-sm-2">{:__('通讯地址')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-address" data-rule="" class="form-control" name="row[address]" type="text"
                value="{$row.address|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-id_card" class="control-label col-xs-12 col-sm-2">{:__('省市区')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="form-inline" data-toggle="cxselect" data-selects="province,city,area">
                <select class="province form-control" data-rule="required" name="row[province]" data-url="ajax/cnarea" data-value="{$row.province_id}"></select>
                <select class="city form-control" data-rule="required" name="row[city]" data-url="ajax/cnarea" data-value="{$row.city_id}"></select>
                <select class="area form-control" data-rule="required" name="row[area]" data-url="ajax/cnarea" data-value="{$row.area_id}"></select>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label for="c-id_card" class="control-label col-xs-12 col-sm-2">{:__('身份证')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-id_card" data-rule="" class="form-control" name="row[id_card]" type="text"
                value="{$row.id_card|htmlentities}">
        </div>
    </div>

    <div class="form-group">
        <label for="c-fx_rate" class="control-label col-xs-12 col-sm-2">{:__('分销佣金比例%')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-fx_rate" data-rule="" class="form-control" name="row[fx_rate]" type="number" step="0.01"
                value="{$row.fx_rate|htmlentities}">
        </div>
    </div>
    {if $auth->acct_id == 0}
    <div class="form-group">
        <label for="content" class="control-label col-xs-12 col-sm-2">{:__('是否分销')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[is_commission]', ['0'=>__('否'), '1'=>__('是')], $row['is_commission'])}
        </div>
    </div>
    {/if}

    <div class="form-group">
        <label for="content" class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[status]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')], $row['status'])}
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>